<template>
	<view>
		<view class="navi-bar">
			<view class="navi-back" @click="goBack">
				<
			</view>
			<view class="navi-title">
				收音机
			</view>
		</view>
		<u-gap height="100" bgColor="#fff"></u-gap>
		<view class="ra-list">
			<view class="ra-item" @click="naviTo(r.content_id)" v-for="(r, i) in UserCollectRadioList">
				<view class="ra-left">
					<image :src="r.cover" mode=""></image>
				</view>
				<view class="ra-right">
					<view class="right-title">
						{{r.title}}
					</view>
					<view class="right-name">
						主播/{{r.author_list[0].user_name}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from '../../untils/http.js'
	
	const url = 'othercollection/8878093/more/8/0'
	
	export default {
		data() {
			return {
				UserCollectRadioList: []
			}
		},
		created() {
			http(url).then(res => {
				this.UserCollectRadioList = res.data
				console.log(this.UserCollectRadioList);
			})
		},
		methods: {
			naviTo(id) {
				uni.navigateTo({
					url: '../RadioContent/RadioContent?id=' + id
				})
			},
			goBack() {
				// 返回上一级并刷新当前页面
				this.$router.go(-1)
			}
		}
	}
</script>

<style lang="scss">
	* {
		box-sizing: border-box;
	}
	
	.navi-bar {
		position: fixed;
		width: 750rpx;
		height: 100rpx;
		line-height: 100rpx;
		z-index: 1000;
		background-color: #fff;
		font-weight: 600;
		
		.navi-back {
			margin-left: 15px;
			float: left;
		}
		
		.navi-title {
			margin-right: 28px;
			text-align: center;
		}
	}
	
	.ra-list {
		width: 750rpx;
	}
	
	.ra-item {
		padding: 5px 10px;
		display: flex;
		width: 100%;
		
		.ra-left {
			margin-right: 10px;
			flex: 1.5;
			width: 100%;
			height: 100rpx;
			
			image {
				width: 100%;
				height: 100%;
				border-radius: 10px;
			}
		}
		
		.ra-right {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			flex: 8.5;
			
			.right-title {
				margin-top: 5px;
				width: 580rpx;
				font-size: 12px;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
			
			.right-name {
				margin-bottom: 5px;
				font-size: 10px;
				color: #888;
			}
		}
	}
</style>
